package com.zoshine.zzg.controller;

import com.github.pagehelper.PageInfo;
import com.zoshine.zzg.annotation.DisableLoginCheck;
import com.zoshine.zzg.base.BaseResponse;
import com.zoshine.zzg.exception.AppException;
import com.zoshine.zzg.exception.ErrorMessage;
import com.zoshine.zzg.pojo.FamilyMemberRecharge;
import com.zoshine.zzg.pojo.Goods;
import com.zoshine.zzg.respons.AppResponse;
import com.zoshine.zzg.service.FamilyMemberRechargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 商品Controller
 *
 * @author 田沛凌
 * @time 2017年6月20日 上午9:38:39
 */
@RestController
@RequestMapping(value = "recharge", method = RequestMethod.POST)
@DisableLoginCheck
public class FamilyMemberRechargeController {
    private FamilyMemberRechargeService familyMemberRechargeService;

    @Autowired
    public void setFamilyMemberRechargeService(FamilyMemberRechargeService familyMemberRechargeService) {
        this.familyMemberRechargeService = familyMemberRechargeService;
    }


    /**
     * 家属充值信息查询(分页)
     *
     * @param familyMemberRecharge
     * @return 商品集合
     */
    @RequestMapping("/pageRecharges")
    public BaseResponse pageGoods(FamilyMemberRecharge familyMemberRecharge) {
        List<FamilyMemberRecharge> familyMemberRechargeList = familyMemberRechargeService.list(familyMemberRecharge);
        return new AppResponse(new PageInfo<>(familyMemberRechargeList));
    }
}
